import {createStore} from 'vuex'

export default createStore({
    state:{
        checkPass:false,
        //当前会员名称，ID，编码
        username:'',
        //id
        userId:'',
        //card_number
        userCode:'',
        //uuid
        userUUID:'',
        //管理员编码、名称、ID
        rootUserCode:'',
        rootUserName:'',
        rootId:'',
        updateUsername:false,
        updatePassword:false,
        userFile:false,
        isRoot:true,
        //当前已连接的wifi
        wifiName:'',
        wifiSignal:50,
        //电池信息
        batterySignal: null,    //电池电量
        batteryIsCharging: false,//是否充电中
        //检测记录ID
        checkId:'',
        //是否发送请求
        sendRequest:true,
        //保存的密码
        savePasswd:'',
        //token
        token:'',
        //设备信息
        deviceCode:'',
        cpuTemperature:0,
        allCapacity:0,
        usedCapacity:0,
        ramSize:0,
        ramUsage:0,
        //店铺信息：名称、账号、密码
        storeName:'',
        storeAccount:'',
        storePassword:'',
    },
    mutations: {
        setBatteryIsCharging:(state,payload)=>{
            state.batteryIsCharging = payload.value
        },
        setBatterySignal:(state,payload)=>{
            state.batterySignal = payload.value
        },
        setUUID:(state,payload)=>{
            state.userUUID = payload.value
        },
        setAllCapacity:(state,payload)=>{
            state.allCapacity = payload.value
        },
        setUsedCapacity:(state,payload)=>{
            state.usedCapacity = payload.value
        },
        setRamSize:(state,payload)=>{
            state.ramSize = payload.value
        },
        setRamUsage:(state,payload)=>{
            state.ramUsage = payload.value
        },
        setCpuTemperature:(state,payload)=>{
            state.cpuTemperature = payload.value
        },
        setDeviceCode:(state,payload)=>{
            state.deviceCode = payload.value
        },
        setStoreName:(state,payload)=>{
            state.storeName = payload.value
        },
        setStoreAccount:(state,payload)=>{
            state.storeAccount = payload.value
        },
        setStorePassword:(state,payload)=>{
            state.storePassword = payload.value
        },
        setToken:(state,payload)=>{
            state.token = payload.value
        },
        setPasswd:(state,payload)=>{
          state.savePasswd = payload.value
        },
        setCheckId:(state,payload)=>{
            state.checkId = payload.value
        },
        setWifiName:(state,payload)=>{
            state.wifiName = payload.value
        },
        setWifiSignal:(state,payload)=>{
            state.wifiSignal = payload.value
        },
        setRootUserCode:(state,payload)=>{
            state.rootUserCode = payload.value
        },
        setRootUserName:(state,payload)=>{
            state.rootUserName = payload.value
        },
        setRootId:(state,payload)=>{
            state.rootId = payload.value
        },
        setCheckPass:(state,payload)=>{
            state.checkPass = payload.value
        },
        setUsername:(state, payload)=>{
            state.username = payload.value
        },
        setUpdateUsername:(state,payload)=>{
            state.updateUsername = payload.value
        },
        setUpdatePassword:(state,payload)=>{
            state.updatePassword = payload.value
        },
        setUserFile:(state,payload)=>{
            state.userFile = payload.value
        },
        setUserID:(state,payload)=>{
            state.userId = payload.value
        },
        setUserCode:(state,payload)=>{
            state.userCode = payload.value
        },
        setIsRoot:(state,payload)=>{
            state.isRoot = payload.value
        }

    },
    actions: {
    },
    modules: {
    }
})